n=int(input())
a=[]
for i in range(n):
    a.append(input())
##for i in range(n):
##    for j in range(i+1,n):
##        if a[j]<a[i]:
##            t=a[j]
##            a[j]=a[i]
##            a[i]=t
listtemp = [(x.lower(),x) for x in a]
for i in range(n):
    print(a[i])
##print([x[1] for x in listtemp]
